﻿Public Class Carnetempleado 

    Private Sub Carnetempleado_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'DbFireAndIceDataSet.vreporteallempleados2' table. You can move, or remove it, as needed.
        Me.Vreporteallempleados2TableAdapter.Fill(Me.DbFireAndIceDataSet.vreporteallempleados2)

    End Sub

    Private Sub SimpleButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpleButton1.Click

        If IdempleadoLookUpEdit.Text = "" Then

            ErrorProvider1.SetError(IdempleadoLookUpEdit, "Seleccione un empleado")
            Return

        End If

        Dim report As New XtraRepCarnetEmpleados

        report.Vreporteallempleados2TableAdapter.Fill(report.DbFireAndIceDataSet1.vreporteallempleados2)
        ' report.Bands(BandKind.Detail).Controls.Add(barcode)


        report.XrLabel3.Text = "Emitido:" & Date.Today.ToString("dd/MM/yyyy") & ""
        report.ShowPreview()
    End Sub

    Private Sub SimpleButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpleButton2.Click
        Dim report As New XtraRepCarnetEmpleados


        If IdempleadoLookUpEdit.Text = "" Then

            ErrorProvider1.SetError(IdempleadoLookUpEdit, "Seleccione un empleado")
            Return

        End If

        ErrorProvider1.SetError(IdempleadoLookUpEdit, Nothing)

        '            Try
        report.Vreporteallempleados2TableAdapter.FillByFiltraporxempleado(report.DbFireAndIceDataSet1.vreporteallempleados2, IdempleadoLookUpEdit.EditValue)

        ' Catch ex As Exception
        'TlogTableAdapter.InsertQueryLogs(TlogTableAdapter.ScalarQueryCountLogs + 1, My.Forms.MDI.Iduser.Caption, My.Resources.StringGlobal.prgNestor, "Pantalla clientes , boton guardar, dentro del insert y update", ex.Message, My.Resources.StringGlobal.mdlClientes, Date.Today, TimeOfDay.TimeOfDay.ToString, My.Computer.Name, Name.ToString, sender.GetType.FullName.ToString)
        'End Try

        'End If




        report.XrLabel3.Text = "Emitido:" & Date.Today.ToString("dd/MM/yyyy") & ""
        report.ShowPreview()
    End Sub

    Private Sub SimpleButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpleButton4.Click

        If IdempleadoLookUpEdit.Text = "" Then

            ErrorProvider1.SetError(IdempleadoLookUpEdit, "Seleccione un empleado")
            Return

        End If
        Dim repot As New XtraRepImprimeCodigobarraEmpelados
        repot.Vreporteallempleados2TableAdapter.Fill(repot.DbFireAndIceDataSet1.vreporteallempleados2)
        repot.ShowPreview()

    End Sub

    Private Sub SimpleButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpleButton3.Click

        If IdempleadoLookUpEdit.Text = "" Then

            ErrorProvider1.SetError(IdempleadoLookUpEdit, "Seleccione un empleado")
            Return

        End If
        Dim repot As New XtraRepImprimeCodigobarraEmpelados
        repot.Vreporteallempleados2TableAdapter.FillByFiltraporxempleado(repot.DbFireAndIceDataSet1.vreporteallempleados2, IdempleadoLookUpEdit.EditValue)
        repot.ShowPreview()
    End Sub
End Class